/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.ws.modelo;

import java.util.List;
import javax.persistence.*;

@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "tipo", discriminatorType = DiscriminatorType.STRING)
public abstract class Representante extends Funcionario {

    @OneToMany(mappedBy = "representante", fetch = FetchType.LAZY,cascade={CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REFRESH})
    private List<Cliente> cateira;

    public List<Cliente> getClientes() {
        return cateira;
    }

    public void setClientes(List<Cliente> carteira) {
        this.cateira = carteira;
    }

    public boolean tranferirCarteira(){
        return true;
    }
}
